﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/FrontEnd.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Giỏ hàng - vuonthieunhi.com
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% List<Order> list = (List<Order>)ViewData["ListOrders"]; %>
    <div class="content_box">
        <div class="roundedcornr_top">
            <div>
            </div>
        </div>
        <div class="roundedcornr_content" style="padding:5px;">
            <% if (list.Count > 0)
               {
                   int index = 0; %>
            <p>
                <strong>Số sản phẩm:
                    <%= list.Count%></strong>
            </p>
            <form method="post" action="/cap-nhat-gio-hang.html">
            <table width="610" cellspacing="2" cellpadding="2" border="0" align="center" class="carttable">
                <tbody>
                    <tr>
                        <td class="menuhdr" style="width:40px">
                            Xóa
                        </td>
                        <td class="menuhdr" style="width:200px">
                            Tên sản phẩm
                        </td>
                        <td class="menuhdr" style="width:100px">
                            Số lượng
                        </td>
                        <td class="menuhdr" style="width:70px">
                            Giá
                        </td>
                        <td class="menuhdr" style="width:100px">
                            Tổng
                        </td>
                    </tr>
                    <% foreach (Order item in list)
                       {
                    %>
                    <tr>
                        <td class="ac">
                            <a href="/xoa-gio-hang/<%=item.Alias %>.html">
                                <img src="../../Themes/images/canvas.png" />
                            </a>
                        </td>
                        <td width="50%" style="text-align: left">
                            <table cellspacing="1" cellpadding="1" border="0" class="cartproduct">
                                <tbody>
                                    <tr>
                                        <td>
                                            <img class="imag" src="<%=Constants.UPLOAD_VITUAL_IMAGE_PATH + item.Image%>" width="132"
                                                height="120" />
                                        </td>
                                        <td>
                                            <%= Html.Hidden("hidID"+index,item.Id) %>
                                            <a href="/san-pham/<%=item.Alias %>.html">
                                                <%=Html.Encode(item.ProductName)%>
                                            </a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                        <td class="ac">
                            <%= Html.TextBox("hidQuantity" + index, item.Quantity, new { @maxlength = "3", @class = "qtytextfield" })%>
                        </td>
                        <td style="text-align: center" class="cellprice">
                            <%=String.Format("{0:0,0}", item.Price)%>
                        </td>
                        <td style="text-align: center" class="cellprice">
                            <%=String.Format("{0:0,0}", item.SubTotal)%>
                        </td>
                    </tr>
                    <%  index++;
                       }%>
                    <tr>
                        <td class="blankcell">
                            &nbsp;
                        </td>
                        <td class="blankcell">
                            &nbsp;
                        </td>
                        <td class="cartprice" colspan="2">
                            <strong>Tổng</strong>
                        </td>
                        <td class="cartprice">
                            <strong>
                                <%= String.Format("{0:0,0}", list.Sum(q=> q.SubTotal))%></strong>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <div class="std_table">
                <div id="cartfoot">
                    <input type="button" onclick="javascript:window.location = '/';" id="btnContinue" value="Tiếp tục mua hàng" name="Tiếp tục mua hàng" class="submitbtn">&nbsp;
                    <input type="submit" value="Cập nhật" name="Cập nhật" class="submitbtn">&nbsp;
                    <input type="button" onclick="javascript:window.location = '/thanh-toan.html';" id="btnOrder" value="Thanh toán" name="Thanh toán" class="submitbtn">&nbsp;
                </div>
            </div>
            </form>
            <%}
               else
               {%>
            <div class="validation">
                Bạn hiện không có chọn sản phẩm nào
            </div>
            <br />
            <hr />
            <br />
            <div align="center">
                <p>
                </p>
            </div>
            <%}
            %>
            <div class="clearfix">
            </div>
        </div>
        <div class="roundedcornr_bottom">
            <div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MetaContent" runat="server">
    <meta name='keywords' content='Giỏ hàng - vuonthieunhi.com' />
    <meta name='description' content='Giỏ hàng - vuonthieunhi.com' />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="TopTitleContent" runat="server">
    <h1 class="titlebar">
        Giỏ hàng</h1>
</asp:Content>
